package corej.exam.com.usermgmt;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("serial")
public class Group implements Serializable {
    private String groupName = null;

    private String gid = null;

    private String userList = null;

    // ��̬map��������е�group����Map��gid,groupName��
    private static Map<String, Group> groupMap = new HashMap<String, Group>();

    public Group() {
        super();
    }

    public Group(String groupName, String gid, String userList) {
        super();
        this.groupName = groupName;
        this.gid = gid;
        this.userList = userList;
        groupMap.put(gid, this);
    }

    public String getGroupName() {
        return groupName;
    }

    public String getGid() {
        return gid;
    }

    public String getUserList() {
        return userList;
    }

    public static Group getGroupByGid(String gid) {
        return groupMap.get(gid);
    }

    // ----------δ���-----------
    public void showUserList() {

    }

    public void showGroupMap() {

    }

    public String toString() {
        return "GROUP_NAME: " + groupName + " GROUP_ID: " + gid;
    }

}